<template>
  <div class="background-image">
    <div class="background-color">
      <div class="helping-friends">
        <img src="../../assets/img/shart.png" class="helping-friends-image">
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HelpingFriends',
  beforeRouteEnter (to, from, next) {
    // if ( localStorage.getItem("helpingFriends") ) {
    //   localStorage.setItem("notRefreshing", "notRefreshing")
    //     window.location.reload()
    // } else if ( localStorage.getItem("notRefreshing") ) {
    //   next()
    //   localStorage.removeItem("notRefreshing")
    //   console.log('会执行吗?')
    // } else {
    //   console.log(next)
    //   next("/PowerListPage?" + to.query.unique_no)
    // }
    if ( localStorage.getItem("helpingFriends") ) {
      next()
      localStorage.setItem("notRefreshing", "notRefreshing")
      localStorage.removeItem("helpingFriends")
      window.location.reload()
    } else if (localStorage.getItem("notRefreshing")) {
      next()
      localStorage.removeItem("notRefreshing")
    } else {
      next("/PowerListPage?" + to.query.unique_no)
    }
  }
}
</script>

<style lang="stylus" scoped>
  .background-image
    width 100%
    height 1334px
    background url("../../assets/img/shareIt-background.png") no-repeat
    background-size cover
    .background-color
      width 100%
      height 100%
      background-color rgba(0, 0, 0, .7)
      position fixed
      top 0 
      left 0
      z-index 1
      .helping-friends
        width 750px
        height 258px
        position fixed
        top -12px
        left 0
        .helping-friends-image
          width 100%
          height auto
</style>
